#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.action import base
from src.model.models import User
class Login(base.BaseAction):
    def get(self):
        self.go(None,'login.htm') 
    def post(self):
        sPassword = self.request.get('txtPassword')
        username=self.request.get('username')
        if sPassword=='123456':
            ## 密码正确
            #self.response.headers.add_cookie('auth',str('yuyu'),86400 * 365)
            if username=='woyo':
            	self.response.headers.add_header("Set-Cookie", "name=woyo;") 
            	self.redirect("/indexYo")
            if username=='yuyu':
            	self.response.headers.add_header("Set-Cookie", "name=yuyu;") 
            	self.redirect("/indexYo")
        else:
            self.go(None,'login.htm') 


